<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=9" />
		<meta http-equiv="pragma" content="no-cache" />
		<title>意见采纳说明</title>
		<%@ include file="../../../common/Admin-list.jsp"%>		
		<script type="text/javascript" src="<%=bpath %>Scripts/common/common.js"></script>
		<link rel="stylesheet" type="text/css" href="<%=basePath %>Themes/default/css/jquery.datetimepicker.css"/>    
		<script type="text/javascript" src="<%=basePath %>Scripts/jquery/jquery.datetimepicker.js"></script>
	
		<!-- 配置文件 -->
	    <script type="text/javascript" src="<%=path %>/Scripts/UEditor/ueditor.config.js"></script>
	    <!-- 编辑器源码文件 -->
	    <script type="text/javascript" src="<%=path %>/Scripts/UEditor/ueditor.all.js"></script>		
		  
		<script type="text/javascript" src="<%=bpath %>Scripts/jquery/jquery.form.js"></script> 		 
		 
		<script type="text/javascript">	
		
		$(function(){
			var subUrl="../solicitPublicController/update.json?type=adopteds";
			
			if('${data.type}'!=null&&'${data.type}'=="edit"){ //编辑模块						
				$("#lblTitle").html('意见采纳说明');				
				$("#id").val('${data.solicitPublic.id}');	
			}		
			
			//保存
			$("#lnbSave").click(function(){								
				$("#addForm").ajaxSubmit({
					url:subUrl,
					type:"POST",
					beforeSubmit:checkForm,
					contentType:"application/x-www-form-urlencoded;charset=UTF-8",
					error:function(){},
					success:function(data){
						if(data.success==true){
							showTip("保存成功，返回列表页面！","succeed");					    	
						}else{
							//showTip("操作失败","warning");  
							art.dialog.alert('保存失败，请确认填写正确！');
						}
					}
				});
			});
			
			
		});
			
		function checkForm(){
			var flag=$('#addForm').form('validate');
			return true;
		}
				
		//消息提示  
		function showTip(mess,icon) {  
		    art.dialog({  
		        id : 'Tip',  
		        title : '消息',  
		        fixed : true,  
		        lock : true,  
		        opacity: .2,  
		        content : mess,  
		        icon : icon,  
		        time : 1  
		    });  
		    setTimeout('originReload()', 1000);  
		}  
		
		//重载来源页面  
		function originReload(){  
		    var win = art.dialog.open.origin;		    
		    win.location.reload();  
		}
			
		</script>
		
</head>
<body>
<!---->
<div>
	<div id="tab">
        <ul>
            <li class="Current">
            	<a href="#" onfocus="this.blur()">
            		<span id="lblTitle" > 意见采纳说明  </span>
            	</a>
            </li>
        </ul>
    </div>  
    <div id="menu">
        <ul>
            <li>
            	<a id="lnbSave">
            		<span><img src="<%=basePath %>pages/Admin/Images/Icon/save.gif" alt="Save" />保存</span>
            	</a>
            </li>
        </ul>
    </div>   
    
    <div id="middle"> 
    <form action="../solicitPublicController/save.json" id="addForm" name="addForm" method="post" >   
    <div class="editor">
        <table class="eTable">               	   
            <tr class="eTr">
                <td class="name">
                    <label id="LabelName" >
                    	<font color="red">请填写    </font>
                    		${data.solicitPublic.title}                    	
                    	<font color="red">  的意见采纳说明！ </font>
                    	<input id="id" name="id" type="hidden"></input>  
                    </label>
                </td>                
            </tr>                      
            <!-- 百度编辑器  -->            
            <tr class="eTr">                
                <td>
                	<!-- 加载编辑器的容器 -->
				    <script id="adopteds" name="adopteds" type="text/plain" style="width:800px;height:200px;">
        				
    				</script>
                </td>
            </tr>
        </table>        
    </div>
    </form> 
    </div>
    
    <!-- 实例化编辑器 -->
    <script type="text/javascript">    
        var ue = UE.getEditor('adopteds',{
        	toolbars:[['Source', 'Undo', 'Redo','Bold','test']],
        	autoHeight: false,
        	autoClearinitialContent:true //清除初始内容        	
        });        
              
       ue.ready(function() {
		    ue.setContent('${data.solicitPublic.adopteds}');
		});		
    </script>
    
</div>
</body>
</html>